/**
 * @(#)com.framework.web.demo.repository.DemoRepository
 *
 * Copyright (c) 2014-2018 上海天跃科技有限公司
 *
 * DESC:
 *
 */
package com.framework.web.sys.repository;

import com.framework.web.sys.domain.CodeItems;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * 字典码表
 * @author fusf
 * @version 1.0  2016/1/7
 */
public interface CodeItemsRepository extends PagingAndSortingRepository<CodeItems, String>,
        JpaSpecificationExecutor< CodeItems> {

        /**
         * 根据类别代码查询有效的代码列表
         * @param categoryCode
         * @return
         */
        @Query("select o from CodeItems o  where  o.codeCategory.categoryCode = ?1 and o.status='0' and o.codeCategory.status='0'")
        public List<CodeItems> findByCategoryCode(String categoryCode);

}
